<!--

This sample illustrates how to request data from a remote server.

-->
<textarea id='mytextarea' style='width: 400px; height: 300px; overflow: scroll'>
Loading... please wait...</textarea>

<script type="text/javascript">
var MY_URL = "http://www.google.com";

function init() {
   var params = {};
   params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT;
   gadgets.io.makeRequest(MY_URL, callback, params);
   debug.say("Request sent. Waiting for reply...");
}

function callback(data) {
   debug.say("Reply received.");
   if (data.data && data.data.length)
      document.getElementById('mytextarea').value = 
          "google.com's page source:\n\n" + data.data;
}

gadgets.util.registerOnLoadHandler(init);

</script>
